﻿using System.Collections.Generic;
using System.Linq;
using FLH.RegionDataAllocations;
using MyFloridaHouse.libSvDTO;

namespace MyFloridaHouse.DataAccess.ExtensionsTS
{
    public static class ConvertRegionDataAllocationsModelToRegionDataAllocationsDTO
    {

        public static List<RegionDataAllocationsDTO> convertList(List<RegionDataAllocationsModel> itemList)
        {
            return itemList.Select(item => ConvertRegionDataAllocationsModelToRegionDataAllocationsDTO.DataContract(item)).ToList();
        }

        public static RegionDataAllocationsDTO DataContract(RegionDataAllocationsModel item)
        {
            return new RegionDataAllocationsDTO
            {
                targetLayerID = item.TargetLayerID,
                targetRegionID = item.TargetRegionID,
                sourceLayerID = item.SourceLayerID,
                sourceRegionID = item.SourceRegionID,
                allocationRatio = item.AllocationRatio,
                squareFootage = item.SquareFootage
            };
        }
    }
}


